<template>
	<view>
		<nav-custom :name="title"></nav-custom>
		<view class="list">
			<view class="back bor_bot">
				<view class="dis_f_sb_c bor_b_bot">
					<view class="black_s_28">旧密码</view>
					<view class="list_bo">
						<u--input placeholder="请填写旧密码" password maxlength="10" fontSize="14" border="none" v-model="value" @blur="blur"></u--input>
					</view>
				</view>
				<view class="dis_f_sb_c bor_b_bot">
					<view class="black_s_28">新密码</view>
					<view class="list_bo dis_f_r_c">
						<u--input placeholder="请填写新密码" password maxlength="10" fontSize="14" border="none" v-model="value1" @blur="blur1"></u--input>
					</view>
				</view>
				<view class="dis_f_sb_c">
					<view class="black_s_28">确认密码</view>
					<view class="list_bo ">
						<u--input placeholder="请再次填写新密码确认" password maxlength="10" fontSize="14" border="none" v-model="value2" @blur="blur2"></u--input>
					</view>
				</view>
			</view>
			<view class="dis_f_sb_c">
				<view class="blue_f_24">登录密码已设置，如需更改请填写上述信息</view>
				<view class="grey_h_24">忘记密码？</view>
			</view>
		</view>
		<view class="bule_back_but white_f_32 bot_wz" @click="submit">
			确定
		</view>
		<!-- <image class="bo_js_img" src="../../static/image/zcxian.png" mode=""></image> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: "登录密码",
				value: '',
				value1: '',
				value2: '',
				url:''
			}
		},
		onShow() {
		      this.url=this.$.ajax_url3	
		},
		methods: {
			submit(){
				if(this.value == ''){
					return this.$.ti_shi('请输入旧密码')
				}
				if(this.value1 == ''){
					return this.$.ti_shi('请输入新密码')
				}
				if(this.value1 != this.value2){
					return this.$.ti_shi('两次密码不一致')
				}
				this.$.ajax(1,'post','store/store/login_passwords',{
					y_password:this.value,
					password:this.value1,
					q_password:this.value2,
				},(res)=>{
					this.$.ti_shi(res.msg)
					if(res.code == 200){
						setTimeout(()=>{
							this.$.back()
						},600)
					}
				});
			},
			blur(e) {
				// console.log('change', e);
			},
			blur1(e) {
				// console.log('change', e);
			},
			blur2(e) {
				// console.log('change', e);
			},
		}
	}
</script>

<style>
	.list {
		margin-top: 200rpx;
		padding: 0 32rpx;
	}

	.list_bo {
		width: 478rpx;
		border-bottom: 2rpx solid #F7FAFF;
		padding-bottom: 10rpx;
		margin-top: 14rpx;
	}
	.r_img {
		width: 32rpx;
		height: 32rpx;
	}
</style>